package utils;



import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;



public class UserData implements Serializable, PropertiesMap {

	private static final long serialVersionUID = -1023822965519598587L;
	
	private Map<String, Object> properties = Collections.synchronizedMap(new HashMap<String, Object>());


	public UserData () {
	}
	
	@Override
	public UserData clone() {
		UserData copy = new UserData();
		for(Map.Entry<String, Object> entry : properties.entrySet()) {
			copy.putProperty(entry.getKey(), entry.getValue());
		}
		return copy;
	}


	@Override
	public Object getProperty (String propertyName) {
		return properties.get(propertyName);
	}


	@Override
	public void purgeProperty (String propertyName) {
		properties.remove(propertyName);
	}

	@Override
	public void putProperty(String propertyName, Object value) {
		properties.put(propertyName, value);
		
	}

}
